<template>
  <div class="page">
    首页-{{hooks.getId()}}
    <h2 v-if="gushi">{{gushi || ''}}</h2>
  </div>
</template>

<script setup>
  // 导入 store 仓库
  import { useStore } from '@/store/index'
  import { ref, reactive, computed, onMounted } from 'vue'
  // 导入路由
  import { useRouter } from 'vue-router'
  import { hooks, http } from '@/common'
  const router = useRouter()
  const store = useStore()

  // 调接口的示例
  const gushi = ref('')
  const getData = async () => {
    const res = await http.get('/dev-api/shici/api.php')
    console.log('古诗', res);
    gushi.value = res?.hitokoto || ''
  }
  getData()

</script>

<style lang="scss" scoped>
  $color: #1BDCFD;

  .page {
    width: 100%;
    height: 100%;
    color: $color;
    font-size: 30px;
  }
</style>